package com.tupi.project.ui.activity;

import android.view.View;
import android.widget.Toast;

import com.tupi.project.R;
import com.tupi.project.base.BaseActivity;
import com.tupi.project.event.SimpleEvent;
import com.tupi.project.ui.contract.RxBusContract;
import com.tupi.project.ui.presenter.RxBusPresenter;

import butterknife.OnClick;

public class RxBusActivity extends BaseActivity<RxBusPresenter> implements RxBusContract.View
{
    private static final String TAG = RxBusActivity.class.getSimpleName();
    
    
    @Override
    protected int getLayout()
    {
        return R.layout.activity_rx_bus;
    }
    
    @Override
    protected void initEventAndData()
    {
        
    }
    
    @Override
    protected void initInject()
    {
        getActivityComponent().inject(this);
    }
    
    @OnClick({R.id.add, R.id.put})
    public void onViewClicked(View view)
    {
        switch (view.getId())
        {
            case R.id.add:
                mPresenter.add();
                break;
            case R.id.put:
                mPresenter.put();
                break;
        }
    }
    
    @Override
    public void showReceive(SimpleEvent simpleEvent)
    {
        Toast.makeText(this, simpleEvent.getContent(), Toast.LENGTH_LONG).show();
    }
}
